<!-- html5 -->
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/template.css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>HappyMeal Management System</title>
</head>

<body>
<div id='all'>
  <div id='all-wrap'> 
    
    <!--header begin-->
    <div id='wrap-header'>
      <?php
			include 'header.php';
			//Forbid Non-admin from adding new user
			if($_SESSION['is_admin'] == 0){
				//Auto redirect
				header("Refresh: 2;url=user.php");
   				die("You do not have the permission to add a new user. Click <a href='user.php'>here</a> if your browser cannot redirect");
			}
		?>
    </div>
    <!--header end--> 
    
    <!--wrap-body begin-->
    <div id='wrap-body'> 
      <!-- wrap-search begin-->
      <div id='wrap-search'> </div>
      <!-- wrap-search end--> 
      
      <!-- wrap-content begin-->
      <div id='wrap-content'>
        <div id='nav' style="padding-left:30px;">
          <h4>Current : <a href='main.php'>Main</a>
            <?php include 'nav_png.php'; ?>
            <a href='user.php'>User</a>
            <?php include 'nav_png.php'; ?>
            User Add</h4>
        </div>
        <!-- user_add begin-->
        <div id='partner_add'>
          <form action='user.php' method='post' id='user_add_form' enctype="multipart/form-data">
            <h3 style='padding-left:50px'>Please enter the information of a new user.</h3>
            <table>
              
              <!-- Telephone -->
              <tr>
                <td width="150sp">Telephone:</td>
                <td><input type='number' name='telephone'></td>
              </tr>
              
              <!-- Email -->
              <tr>
                <td width="150sp">IMEI:</td>
                <td><input type='number' name='imei'></td>
              </tr>
              
              <!-- Name -->
              <tr>
                <td width="150sp">Name:</td>
                <td><input type='text' name='name'></td>
              </tr>
              
              <!-- Description -->
              <tr>
                <td width="150sp">Description:</td>
                <td><textarea rows="4" cols="50" name="description" form="user_add_form"></textarea></td>
              </tr>
              
              <!-- Profile Picture -->
              <tr>
                <td width="150sp">Profile Picture:</td>
                <td><input type='file' name='profile'>
                  <br>
                  Picture must be less than 1000kb</td>
              </tr>
              
              <!-- Is blocked -->
              <tr>
                <td width="150sp">Blocked? :</td>
                <td><select name='is_blocked'>
                    <option value=''>----SELECT----</option>
                    <option value='0'>NO</option>
                    <option value='1'>YES</option>
                  </select></td>
              </tr>
              
              <!-- Is activated -->
              <tr>
                <td width="150sp">Activated? :</td>
                <td><select name='is_activated'>
                    <option value=''>----SELECT----</option>
                    <option value='0'>NO</option>
                    <option value='1'>YES</option>
                  </select></td>
              </tr>
              
              <!-- Submit -->
              <tr>
                <td></td>
                <td align="left"><input type='submit' name='user_add' value='Add' onclick="return promptConfirm()">
                  <input type='button' name='user_cancel' value='Cancel' onclick='window.location="user.php";' /></td>
              </tr>
            </table>
          </form>
        </div>
        <!-- user_add end --> 
      </div>
      <!-- wrap-content end--> 
      
    </div>
    <!--wrap-body end--> 
    
    <!--wrap-footer begin-->
    <div id='wrap-footer'>
      <?php
			include 'footer.php';
		?>
    </div>
    <!--wrap-footer end--> 
    
  </div>
  <!-- all-wrap end--> 
</div>
<!-- all end-->
</body>
</html>